package com.thunbu.thunbu_meeting_system.service

import com.thunbu.lib_common.config.BaseResponse
import com.thunbu.thunbu_meeting_system.bean.*
import okhttp3.MultipartBody
import okhttp3.RequestBody
import retrofit2.Call
import retrofit2.http.*


/**
 *Created by Chaolue.Fan on 2021/5/19
描述:
 */
interface ApiService {

    /**
     * 唯一标识与授权码的绑定
     * */
    @GET("/client/createEquipment")
    fun createEquipment(@Query(value = "equipmentCode") equipmentCode:String):Call<BaseResponse<Any?>>

    /**
     * 确认授权
     * */
    @GET("/client/queryEquipment")
    fun queryEquipment(
            @Query(value = "equipmentCode") equipmentCode:String,
            @Query(value = "equipmentAuthorization") equipmentAuthorization:String
    ):Call<BaseResponse<Any?>>
    /**
     * 登录
     */
    @POST( "/client/appLogin")
    fun doLogin(
        @Query("phoneNumber") phoneNumber: String,
        @Query("password") password: String,
        @Query("tenantCode") tenantCode: String,
    ): Call<BaseResponse<UserInfo>>

    /**
     * 获取全部单位
     * */
    @GET("/client/getTenantList")
    fun getCompanys(@Query("phoneNumber") phoneNumber: String):Call<BaseResponse<List<CompanyInfo>>>

    /**
     * 登出
     * */
    @GET( "/client/logout")
    fun logout(
    ): Call<BaseResponse<Any?>>

    /**
     * 首页数据
     * */
    @GET("/client/stock/app/queryHomePage")
    fun getHomeInfo(): Call<BaseResponse<HomeModel>>


    /**
     * 查询资产列表
     * */
    @POST("/client/stock/app/queryAssetList")
    fun queryAssetList(
        @Body requestBody: RequestBody
    ): Call<BaseResponse<AssetPageModel>>

    /**
     * 查询资产分类
     * */
    @POST("/client/category/getCategoryGroup")
    fun getCategoryGroup(
            @Body requestBody: RequestBody
    ): Call<BaseResponse<AssetTypeModel>>

    /**
     * 查询存放地址列表
     * */
    @GET("/client/place/get_place_list")
    fun get_place_list(
    ): Call<BaseResponse<List<AddressModel>>>

    /**
     * 查询部门组织列表
     * */
    @GET("/client/user/getTenantAllDept")
    fun getTenantAllDept(
    ): Call<BaseResponse<DepartmentModel>>

    /**
     * 查询部门组织人员列表
     * */
    @GET("/client/user/getTenantAllDeptUser")
    fun getTenantAllDeptUser(
    ): Call<BaseResponse<DepartmentModel>>

    /**
     * 查询待办列表
     * */
    @POST("/client/stock/app/queryAgentList")
    fun queryAgentList(
            @Body requestBody: RequestBody
    ): Call<BaseResponse<TodoWapperModel>>

    /**
     * 查询盘点任务
     * */
    @POST("/client/stock/app/queryStockList")
    fun queryStockList(
            @Body requestBody: RequestBody
    ): Call<BaseResponse<StockPageModel>>

    /**
     * 查询资产列表
     * */
    @POST("/client/stock/task/list")
    fun queryTaskList(
            @Body requestBody: RequestBody
    ): Call<BaseResponse<AssetPageModel>>

    /**
     * 批量操作资产
     * */
    @POST("/client/stock/task/batch/operate")
    fun operate(
            @Body requestBody: RequestBody
    ): Call<BaseResponse<Any?>>

    /**
     * 新增盘点
     * */
    @POST("/client/stock/task/insertDiskSurplus")
    fun insertDiskSurplus(
            @Body requestBody: RequestBody
    ): Call<BaseResponse<Any?>>


    /**
     * 上传文件
     * */
    @Multipart
    @POST("/client/oss/uploadOssFiles")
    fun uploadOssFiles(
            @PartMap params:MutableMap<String, RequestBody> ,
            @Part files:MutableList<MultipartBody.Part>
    ): Call<List<String>?>

    /**
     * 资产卡片详情
     */
    @GET( "/client/stock/task/queryTaskDetail")
    fun queryTaskDetail(
        @Query("id") id: String,
    ): Call<BaseResponse<AssetModel>>

    /**
     * 资产卡片详情
     */
    @GET( "/client/assetAccount/queryAssetById")
    fun queryTaskDetail2(
            @Query("id") id: String,
    ): Call<BaseResponse<AssetModel>>

    /**
     * 扫码结果1(根据码中的GS1查询)
     */
    @GET( "/client/stock/app/queryAssetByGs1")
    fun queryAssetByGs1(
        @Query("gs1") gs1: String,
        @Query("stockTaskCode") stockTaskCode: String,
    ): Call<BaseResponse<AssetModel?>>

    @GET( "/client/queryDetail")
    fun queryDetail(
        @Query("guId") guId: String
    ): Call<BaseResponse<GuidModel?>>

    /**
     * 修改卡片详情
     */
    @POST( " /client/stock/task/updateTaskDetail")
    fun updateTaskDetail(
        @Body requestBody: RequestBody
    ): Call<BaseResponse<Any?>>

    /**
     * 扫码登记页面信息
     */
    @POST( " /client/register/app/queryAppInventoryList")
    fun queryAppInventoryList(
            @Body requestBody: RequestBody
    ): Call<BaseResponse<ScanRegisterWapperModel>>


    /**
     * 根据rfid16进制编码集合批量获取GS1码
     * */
    @POST("/client/assetAccount/queryGs1List")
    fun queryGs1List(
        @Body list: List<String>
    ): Call<BaseResponse<List<String>>>


    /**
     * 批量删除盘盈
     * */
    @POST("/client/stock/task/deleteDiskSurplus")
    fun deleteDiskSurplus(
            @Body list: List<String?>
    ): Call<BaseResponse<Any?>>
}